<?php

$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
$pid = empty($_GET['pid']) ? 0 : intval($_GET['pid']);

$oLibrary = new Library();

if($id > 0){
	$library_info = $oLibrary->get_row($id, 'id,pid,name,mark,memo');
	$library_tree = $oLibrary->get_library_tree_ul(0, $id); // 取分类树
}else{
	$library_info['pid'] = $pid;
	$library_tree = $oLibrary->get_library_tree_ul($pid); // 取分类树
}

if($library_info['pid'] > 0){
	$parent_library = $oLibrary->get_row($library_info['pid'], 'id,name');
	$library_info['parent_name'] = $parent_library['name'];
}else{
	$library_info['pid'] = '0';
	$library_info['parent_name'] = $__l['root'];
}

$library_info['library_tree'] = $library_tree;
$vars['info'] = $library_info;

?>